<template>
	<view class="xc-block">
		<view class="xc-title" v-if="control.now<sr.paper.cfgbegintime">{{$t('xp.paper.msg_answer_notbegin')}}
		</view>
		<view class="xc-title" v-if="control.now>sr.paper.cfgendtime">{{$t('xp.paper.msg_answer_alreadyend')}}
		</view>
		<view class="xc-content">{{$t('xp.paper.label_cfgbegintime')}}:
			{{xsDatetimeUtils.timestampToString(sr.paper.cfgbegintime)}}
		</view>
		<view class="xc-content">{{$t('xp.paper.label_cfgendtime')}}:
			{{xsDatetimeUtils.timestampToString(sr.paper.cfgendtime)}}
		</view>
	</view>
</template>
<script>
	import config from "@/config/config.js";
	import xcHttpUtils from '@/library/xcore/js/XcHttpUtils.js';
	import xcViewUtils from '@/library/xcore/js/XcViewUtils.js';
	import {
		xsStringUtils,
		xsDateUtils,
		xsDatetimeUtils,
		xsArrayUtils
	} from 'xstack-for-javascript';

	export default {
		props: {
			data: {
				type: Object,
				default: []
			}
		},
		watch: {
			'data': {
				handler(newVal, oldVal) {
					let that = this;
					that.public_show();
				},
			},
		},
		emits: ['reset_parent'],
		data() {
			return {
				config: config,
				xsStringUtils: xsStringUtils,
				xsDateUtils: xsDateUtils,
				xsDatetimeUtils: xsDatetimeUtils,
				sp: {},
				sr: {
					paper: [],
				},
				control: {
					now:null,
				}
			}
		},
		created() {
			let that = this;
			that.xinit();
			that.public_show();
		},
		methods: {
			xinit() {
				let that = this;
			},
			public_show() {
				let that = this;
				that.sr.paper = that.data.paper;
				that.control.now = new Date().getTime() / 1000;
			},
			public_reset() {
				let that = this;
				that.public_show();
			},
		}
	}
</script>

<style lang="scss">

</style>